{% set page_name = "快速实名认证" %}
{% import "components/nothing.html" as nothing with context %}
{% import "components/paginator.html" as paginator with context %}
{% extends "realname_base.html" %}
{% block realname_content %}
        <div class="section">
            <div class="section__header">
                <h1 class="section__title">{{ _('快速实名认证') }}</h1>
                <div class="section__tools">
	        </div>
            </div>
            <div class="section__body no-padding">
                <div data-fragment-id="ranking">
                    {% if not udocs.length %}
                    {{ nothing.render('没有用户！') }}
                    {% else %}
                    <table class="data-table">
                        <colgroup>
                            <col class="col--uid" style="width:5rem">
                            <col class="col--flag" style="width:6rem">
                            <col class="col--name" style="width:5rem">
                            <col class="col--user">
                            <col class="col--displayName" style="width:8rem">
                            <col class="col--school" style="width:8rem">
                            <col class="col--actions" style="width:6rem">
                        </colgroup>
                        <thead>
                            <tr>
                                <th class="col--uid">{{ _('User ID') }}</th>
                                <th class="col--flag">{{ _('标记') }}</th>
                                <th class="col--name">{{ _('姓名') }}</th>
                                <th class="col--user">{{ _('Username') }}</th>
                                <th class="col--displayName">{{ _('Display Name') }}</th>
                                <th class="col--school">{{ _('School') }}</th>
                                <th class="col--actions">{{ _('Actions') }}</th>
                            </tr>
                        </thead>
                        <tbody>
                            {%- for udoc in udocs -%}
                            <tr>
                                <td class="col--uid">{{ udoc._id }}</td>
                                {%- if udoc.realname_flag == 1 -%}
                                <td> {{ _('学生') }} </td>
                                {%- elif udoc.realname_flag == 2 -%}
                                <td> {{ _('老师') }} </td>
                                {%- else -%}
                                <td> {{ _('未设置身份') }} </td>
                                {%- endif -%}
                                <td>{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}{{ udoc.realname_name }}{% endif %}</td>
                                <td class="col--user">
                                    {{ user.render_inline(udoc) }}
                                </td>
                                <td class="col--displayName">{{ udoc.displayName }}</td>
                                <td class="col--school">{{ udoc.school }}</td>
                                <td class="col--actions">
				    <a href="{{ url('realname_set') }}?uname={{ udoc.uname }}&name={{ udoc.displayName }}">{{ _('实名认证') }}</a>
				</td>
                            </tr>
                            {%- endfor -%}
                        </tbody>
                    </table>
                    {{ paginator.render(page, upcount) }}
                    {% endif %}
                </div>
            </div>
        </div>
{% endblock %}